package cn.scw.project.goods.domain;

import cn.scw.framework.aspectj.lang.annotation.Excel;
import cn.scw.framework.web.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import java.util.Date;

/**
 * 优惠券对象 g_coupon
 *
 * @author api
 * @date 2020-05-20
 */
public class GCoupon extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 优惠券id */
    private Long id;

    /** 优惠券金额 */
    @Excel(name = "优惠券金额")
    private double money;

    /** 优惠券名称 */
    @Excel(name = "优惠券名称")
    private String name;

    /** 优惠券数量 */
    @Excel(name = "优惠券数量")
    private int count;

    /** 优惠券剩余数量 */
    @Excel(name = "优惠券剩余数量")
    private int residue;

    /** 优惠券说明 */
    @Excel(name = "优惠券说明")
    private String details;

    /** 开始日期 */
    @Excel(name = "开始日期", width = 30, dateFormat = "yyyy-MM-dd")
    private Date startDate;

    /** 结束日期 */
    @Excel(name = "结束日期", width = 30, dateFormat = "yyyy-MM-dd")
    private Date endDate;

    /** 是否过期 */
    @Excel(name = "是否过期")
    private boolean isOverdue=false;

    /** 是否新用户专用（新用户，所有用户） */
    @Excel(name = "可领取用户", readConverterExp = "新用户，所有用户")
    private boolean isNewUser=false;

    /** 使用范围（0全场，1设备采购，2设备租赁，3办公打印）——字典表维护 */
    @Excel(name = "使用范围", readConverterExp = "全场，设备采购，设备租赁，办公打印")
    private String useScopeCode;

    /** 创建日期 */
    @Excel(name = "创建日期", width = 30, dateFormat = "yyyy-MM-dd")
    private Date createDate=new Date();

    public void setId(Long id)
    {
        this.id = id;
    }

    public Long getId()
    {
        return id;
    }
    public void setMoney(double money)
    {
        this.money = money;
    }

    public double getMoney()
    {
        return money;
    }
    public void setName(String name)
    {
        this.name = name;
    }

    public String getName()
    {
        return name;
    }

    public int getCount() {
        return count;
    }

    public void setCount(int count) {
        this.count = count;
    }

    public int getResidue() {
        return residue;
    }

    public void setResidue(int residue) {
        this.residue = residue;
    }

    public void setDetails(String details)
    {
        this.details = details;
    }

    public String getDetails()
    {
        return details;
    }
    public void setStartDate(Date startDate)
    {
        this.startDate = startDate;
    }

    public Date getStartDate()
    {
        return startDate;
    }
    public void setEndDate(Date endDate)
    {
        this.endDate = endDate;
    }

    public Date getEndDate()
    {
        return endDate;
    }

    public boolean isNewUser() {
        return isNewUser;
    }

    public void setNewUser(boolean newUser) {
        isNewUser = newUser;
    }

    public boolean isOverdue() {
        return isOverdue;
    }

    public void setOverdue(boolean overdue) {
        isOverdue = overdue;
    }


    public void setUseScopeCode(String useScopeCode)
    {
        this.useScopeCode = useScopeCode;
    }

    public String getUseScopeCode()
    {
        return useScopeCode;
    }
    public void setCreateDate(Date createDate)
    {
        this.createDate = createDate;
    }

    public Date getCreateDate()
    {
        return createDate;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
            .append("id", getId())
            .append("money", getMoney())
            .append("name", getName())
            .append("count", getCount())
            .append("details", getDetails())
            .append("startDate", getStartDate())
            .append("endDate", getEndDate())
            .append("isNewUser", isNewUser())
            .append("useScopeCode", getUseScopeCode())
            .append("createDate", getCreateDate())
            .toString();
    }

}
